-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix dialog requestClose()
to handle edge case
#10983
base: main
Are you sure you want to change the base?
Conversation
67f78ff
to
bc0f5ec
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this is more temporary patches since we haven't fixed the asymmetry between setting open
and calling show()
.
@mfreed7 PTAL?
Yeah idk what the end result we want is, perhaps we can change this to an assert in future and make sure close watcher is created when open is added but for now this seems like the minimal fix to prevent a crash. I think it's potentially worth a discussion at whatnot about what we envisage the end state to be for the open attribute because it causes many an issue so it might be worth spending time fully fixing it up. |
Dialog requestClose() now directly calls close the dialog if dialog's close watcher is null. This replaces a previous assert that's wrong.
bc0f5ec
to
e2f7801
Compare
So I just put up a patch in Chromium to fix (I think all?) of these crasher/assert cases. Instead of relaxing the asserts, it adds attribute change steps for |
Provided there's no unexpected behaviour (such as the dialog being added to the list (set in chrome so might not be noticed) twice when calling show() and showModal()) I think that's preferable. Would solve the initially open case too. For the sake of completeness I think it should match |
Fix dialog
requestClose()
to handle edge caseDialog requestClose() now directly calls close the dialog if dialog's close watcher is null.
This replaces a previous assert that's wrong.
requestClose()
subtests for initially open dialog web-platform-tests/wpt#50432(See WHATWG Working Mode: Changes for more details.)
/interactive-elements.html ( diff )